//
// Created by Tony on 2024/7/9.
//

#ifndef RT_CODE_MEMBER_REF_H
#define RT_CODE_MEMBER_REF_H

#include "SymRef.h"
#include <cstdint>

namespace RtCode {

class MemberRef : public SymRef {
    uint16_t memberNameIndex;

public:
    MemberRef(const shared_ptr<ConstantPool>& constantPool, uint16_t classNameIndex,
              uint16_t memberNameIndex)
        : SymRef(constantPool, classNameIndex), memberNameIndex(memberNameIndex) {}

    uint16_t getMemberNameIndex() const { return memberNameIndex; }
    string memberName() const;
};

} // namespace RtCode

#endif // RT_CODE_MEMBER_REF_H
